package com.ad_hccm.dao.TreatmentHistory;

import com.ad_hccm.domain.TreatmentHistory.TopicalMedicine;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 外用药物Dao
 */
@Mapper
public interface TopicalMedicineDao {
    @Insert("insert into topical_medicine value(#{id}, #{isHormone}, #{hormone}, #{isImmunosuppressant}, #{Immunosuppressant}, #{isOther}, #{other})")
    public boolean save(TopicalMedicine topicalMedicine);

    @Update("update topical_medicine set isHormone = #{isHormone}, hormone = #{hormone}, isImmunosuppressant = #{isImmunosuppressant}, Immunosuppressant = #{Immunosuppressant}, isOther = #{isOther}, other = #{other} where id=#{id}")
    public boolean update(TopicalMedicine topicalMedicine);

    @Select("select * from topical_medicine where id=#{id}")
    public TopicalMedicine getById(String id);

    @Select("select * from topical_medicine")
    public List<TopicalMedicine> getAll();
}